<?php
namespace Home\Controller;
use Common\Controller\BaseApiController;
class UserController extends BaseApiController{
	
	private $userService = null;
	
	function __construct() {
		$this->userService = D("User","Service");
	}
	
	public function login(){
		$userName = I("name");
		$pwd = I("pwd");
		$userInfo = $this->userService->login($userName, $pwd);
		
		if($userInfo){
			$userInfo = $this->userService->getUserDetail($userInfo["id"]);
		}
		$this->responseAjaxData($userInfo);
	}
	
	public function getDetail(){
		$userid = I("id");
		
		$userInfo = $this->userService->getUserInfo($userid);

		$this->responseAjaxData($userInfo);
	}
}